/*
 * Terrain.java
 */

package terrain;

import units.Unit;
import enums.MovementType;

/**
 * Basic terrain class that all terrain will inherit from.
 * 
 * @author Travis Drake
 * 
 * @version Oct 3, 2012
 */
// @KENNY abstract classes cannot be instantiated, but must be implemented by subclasses.
// This class defines methods that our terrain classes MUST implement.
public abstract class Terrain
{    
    private TerrainType my_terrain_type;
    
    /**
     * This method will accept the unit type as a parameter, so that it can return the movement type that
     * this worker may use to traverse said terrain.
     * 
     * @param the_unit The unit attempting to travel the terrain. Unit rather than ant
     *                      so that we can use this to apply to non-ant units.
     * @return the type of movement the unit may use to pass the terrain.
     */
    public abstract MovementType isPassable(final Unit the_unit);
    // So this is an abstract method call. Rather than writing a generic method that all subclasses will inherit,
    // we will force them to each have their own, because they may deal with different ant types in different
    // ways (eg soldier ants may swim at partial speed through water, while worker ants may not swim, etc.
    // 
    // By passing the unit itself we can also test the specific unit for effects, IE ant carrying a heavy load
    // cannot swim, etc.
   

    /**
     * Gets the terrain's terrain type.
     * 
     * @return the terrain's terrain type.
     */
    public TerrainType getType()
    {
        return my_terrain_type;
    }
    
}

